# Maintainer: Orhun Parmaksız <orhun@archlinux.org>
# Contributor: Misaka13514 <Misaka13514 at gmail dot com>

pkgname=mastodon-twitter-sync
pkgver=1.10.0
pkgrel=1
pkgdesc="Synchronizes posts from Mastodon to Twitter and back"
arch=('loong64' 'x86_64')
url="https://github.com/klausi/mastodon-twitter-sync"
license=('GPL3')
depends=('gcc-libs')
makedepends=('cargo')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('ccb640dffd6814c274d8aaf61bb743a87256744e5780f5173a82e0151d4e9056')
options=('!lto')

prepare() {
  cd "$pkgname-$pkgver"
  cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
  cd "$pkgname-$pkgver"
  cargo build --frozen --release
}

check() {
  cd "$pkgname-$pkgver"
  cargo test --frozen
}

package() {
  cd "$pkgname-$pkgver"
  install -Dm 755 -t "$pkgdir/usr/bin/" "target/release/$pkgname"
  install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
}

# vim: ts=2 sw=2 et:
